# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=bytecode-viewer
pkgver=2.12
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-binary' 'blackarch-reversing')
pkgdesc='A Java 8/Android APK Reverse Engineering Suite.'
arch=('any')
url='https://github.com/Konloch/bytecode-viewer'
license=('custom:unknown')
depends=('java-environment')
makedepends=('git')
source=("https://github.com/Konloch/bytecode-viewer/releases/download/v$pkgver/Bytecode-Viewer-$pkgver.jar")
noextract=("Bytecode-Viewer-$pkgver.jar")
sha512sums=('977515c2e7dac54a55737dbb267c073e4536cca5be0de8276c37a53cdfe99965392db1626b4c56abcda34a9527933ebcbcb44d8250a8c559ee7930bb3ed734b9')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "Bytecode-Viewer-$pkgver.jar" \
    "$pkgdir/usr/share/$pkgname/Bytecode-Viewer-$pkgver.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar "/usr/share/$pkgname/Bytecode-Viewer-$pkgver.jar" "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

